package com.mylater.nace.compiler;

import javax.tools.FileObject;
import javax.tools.ForwardingJavaFileManager;
import javax.tools.JavaFileObject;
import javax.tools.StandardJavaFileManager;

/**
 * ClassFileManager
 * Description:
 * CreateDate: 2018/8/24 16:59
 *
 * @author HaoJie
 */
public class ExJavaFileManager extends ForwardingJavaFileManager<StandardJavaFileManager> {

    private ExJavaFileObject javaFileObject;

    public ExJavaFileObject getJavaClassObject() {
        return javaFileObject;
    }

    protected ExJavaFileManager(StandardJavaFileManager fileManager) {
        super(fileManager);
    }

    @Override
    public JavaFileObject getJavaFileForOutput(Location location, String className, JavaFileObject.Kind kind, FileObject sibling) {
        javaFileObject = new ExJavaFileObject(className, kind);
        return javaFileObject;
    }
}
